package com.example.elasticsearch.config;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Primary;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = "spring.elasticsearch.rest.extend")
public class ESExtendProperties {
    //自定义扩展ES客户端属性
    private List<Server> servers;


    /**
     * 如果yaml装配内部类，则该内部类必须是static。
     */
    @Data
    public static class Server{
        private String hostIp;
        private int port;
    }
}
